<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>style的绑定</h2>
      <!-- style也做了增强，也允许使用对象或者数组了 -->
      <!-- key是css的属性，value是属性值(变量或者表达式) -->
      <p :style="{ color: red, 'font-size': size + 'px' }">
        一帆风顺的不是人生
      </p>
      <button @click="fn">btn</button>

      <p :style="[{color: red}, {'font-size': size + 'px'}]">
        阴差阳错的才是人生
      </p>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const { createApp } = Vue;

      createApp({
        data() {
          return {
            red: "red",
            size: 30,
          };
        },
        methods: {
          fn() {
            this.size++;
          },
        },
      }).mount("#app");
    </script>
  </body>
</html>
